#ifndef __LM_PARSER_H__
#define __LM_PARSER_H__

#include "../common/lm_list.h"
#include "lm_macro.h"

#ifdef __cplusplus
extern "C" {
#endif


typedef enum lm_parser_err {
    LM_PARSER_OK = 0,
    LM_PARSER_SYNTAX = 1,
    LM_PARSER_NOT_MATCH = 2,

}lm_parser_err_e;


//flag: false->get value from defconfig and menu config 
// true-> get value from menu config 
int lm_parser_get_macro_depend_value(lm_macro_t *macro, bool flag);

int lm_parser_main(const char* defconf_path, const char* conf_path);

void lm_parser_rescan_menu_macro(lm_macro_t *menu);

int lm_parser_gen_header_file(lm_macro_t *menu, const char* file_path);
int lm_parser_gen_config_file(lm_macro_t *menu, const char* file_path);

lm_macro_t *lm_parser_get_menu_root(void);


int lm_parser_args_write_file(lm_macro_t *menu, const char *conf_path, const char* file_path);

#ifdef __cplusplus
} /*extern "C"*/
#endif


#endif //!__LM_PARSER_H__
